get analytics child content published
Track daily comment activity on TabNews content to analyze engagement and interactions using the MCP TabNews Integration server.
Instructions
To get how many comments were made (per day) in tabnews
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/status.ts:253-277 (handler)The async handler function that executes the tool's core logic: fetches analytics data using the service function and formats it as MCP-compliant text content with JSON stringification.handler: async (): Promise<McpResponse> => { try { const result = await getAnalyticsChildContentPublished(); const content: McpTextContent = { type: "text", text: `Analytics Child Content Published:\n\n${JSON.stringify( result, null, 2 )}`, }; return { content: [content], }; } catch (error) { if (error instanceof Error) { throw new Error( `Failed to get analytics child content published: ${error.message}` ); } else { throw new Error("Failed to get analytics child content published"); } }
- src/index.ts:73-78 (registration)The server.tool() registration call that adds this tool to the MCP server instance.server.tool( getAnalyticsChildContentPublishedTool.name, getAnalyticsChildContentPublishedTool.description, getAnalyticsChildContentPublishedTool.parameters, getAnalyticsChildContentPublishedTool.handler );
- src/services/api.ts:103-112 (helper)Supporting service function that makes the HTTP request to the TabNews API endpoint for child content (comments) published analytics data.export async function getAnalyticsChildContentPublished(): Promise< AnalyticsChildContentPublished[] > { const response = await fetch( `${TABNEWS_API_URL}/analytics/child-content-published` ); const data = await response.json(); return data as AnalyticsChildContentPublished[]; }